<template>
  <u-modal :show="pShow" title="温馨提示">
      <view slot="default" class="py-10 color6">
        <view class="tc">您暂未登录</view>
        <view class="tc pt-2">{{ tips }}</view>
      </view>
      <view slot="confirmButton" class="pb-10">
        <u-button
          type="primary"
          text="立即登录"
          :customStyle="{
            fontSize: '32rpx',
            borderRadius: '20rpx',
            height: '88rpx',
          }"
          open-type="getPhoneNumber"
          @getphonenumber="getPhoneNumber"
        ></u-button>
      </view>
    </u-modal>
</template>

<script>
  export default {
    props: {
      show: {
        type: Boolean,
        default: false
      },
      tips: {
        type: String,
        default: '点击立即登录,登录后即可操作'
      }
    },
    watch: {
      show(nval) {
        this.pShow = nval;
      },
      pShow(nval) {
        if (!nval) {
          this.$emit("close");
        }
      },
    },
    data () {
      return {
        pShow: false,
      }
    },
    methods: {
      // 立即登录
      getPhoneNumber(e) {
        this.$store.dispatch("getPhoneNumber", e).then(() => {
          this.pShow = false;
          this.$emit('loginReturn')
        });
      },
    }
  }
</script>

<style scoped lang="scss">

</style>